//返回值：arg1加上arg2的精确结果
function add(arg1, arg2) {
  var r1 = 0,r2 = 0;
  if (!isNaN(arg1))
    r1 = Number(arg1)*100;
  if (!isNaN(arg2))
    r2 = Number(arg2) * 100;
  var result = (r1 + r2)/100;
  return result;
}

//减法函数
function sub(arg1, arg2) {
  var r1 = 0, r2 = 0;
  if (!isNaN(arg1))
    r1 = Number(arg1) * 100;
  if (!isNaN(arg2))
    r2 = Number(arg2) * 100;
  var result = (r1 - r2) / 100;
  return result;
}

module.exports = {
  add: add,
  sub: sub
}
